home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 469 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.8 KB  |  41 lines

  1. Newsgroups: comp.std.c
  2. Path: howland.reston.ans.net!torn!sq!msb
  3. From: msb@sq.com (Mark Brader)
  4. Subject: Re: Is a diagnostic required?
  5. Message-ID: <1996Feb29.185548.29183@sq.com>
  6. Organization: SoftQuad Inc., Toronto, Canada
  7. References: <1996Feb23.090526.7591@sq.com> <danpop.824999740@rscernix> <218226403wnr@pires.co.uk>
  8. Date: Thu, 29 Feb 1996 18:55:48 GMT
  9.  
  10. In the context of this question:
  11. > > > Does the following code require a diagnostic?
  12. > > >     foo() { }
  13. > > >     main() { foo(3); } > 
  14.  
  15. More than 90 lines of my posting were then quoted to respond to one sentence:
  16. > > I must say it's rather disgusting that none of the compilers Dan tried was
  17. > > was smart and helpful enough to produce the diagnostic anyway -- it would
  18. > > after all be easy enough for them to do so in this case.  
  19.  
  20. As follows:
  21. > Don't be too unfair to the compiler writers - they're trying to write
  22. > compilers that accept K&R C as well as ISO C. You may not think this is a
  23. > good idea, but there's vast amounts of legacy code with K&R header 
  24. > files out there....
  25.  
  26. I have no objection to a compiler choosing to *accept* this code, only to
  27. its doing so silently.  Even in K&R1, it was not exactly blessed; page 71
  28. does say that it will be "generally" safe, but the actual definition of
  29. function calls on page 168 makes no such promise.  17 or 18 years have
  30. passed since K&R1 appeared, and I don't believe that silent acceptance
  31. of such code, when the mismatch could easily be diagnosed, is doing
  32. anyone a favor.
  33.  
  34. (As I said the last time, I withdraw the objection if the compiler is one
  35. intended to be used with a separate lint-type checker.)
  36. -- 
  37. Mark Brader, msb@sq.com             "Constrain your data early and often."
  38. SoftQuad Inc., Toronto                      -- C. M. Sperberg-McQueen
  39.  
  40. My text in this article is in the public domain.
  41.